feat: Add agent tasks API support#4225
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4225 +/- ##
=======================================
Coverage 97.48% 97.48%
=======================================
Files 191 192 +1
Lines 19206 19303 +97
=======================================
+ Hits 18723 18818 +95
- Misses 268 269 +1
- Partials 215 216 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
gmlewis
left a comment
There was a problem hiding this comment.
Thank you, @danyalahmed1995!
Just a couple tweaks/questions, then we should be ready for a second LGTM+Approval from any other contributor to this repo before merging.
cc: @stevehipwell - @alexandear - @zyfy29 - @Not-Dhananjay-Mishra - @munlicode
Co-authored-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com>
|
@gmlewis Thanks, sounds good. I’ll address the review comments and push an update shortly. |
gmlewis
left a comment
There was a problem hiding this comment.
Thank you, @danyalahmed1995!
LGTM.
cc: @stevehipwell - @alexandear - @zyfy29 - @Not-Dhananjay-Mishra - @munlicode
stevehipwell
left a comment
There was a problem hiding this comment.
Thanks for the PR @danyalahmed1995, I've added a couple of comments.
Co-authored-by: Oleksandr Redko <oleksandr.red+github@gmail.com>
|
@stevehipwell @alexandear updated, thanks for the reviews. Changes in the latest update:
Validation:
|
|
@alexandear @stevehipwell Thanks for pointing me to the right direction. Root cause was generator-side: the Agent Tasks documentation URLs did not include an explicit I added a narrow metadata mapping for Validation:
|
Co-authored-by: Oleksandr Redko <oleksandr.red+github@gmail.com>
Co-authored-by: Oleksandr Redko <oleksandr.red+github@gmail.com>
Co-authored-by: Oleksandr Redko <oleksandr.red+github@gmail.com>
Co-authored-by: Oleksandr Redko <oleksandr.red+github@gmail.com>
Co-authored-by: Oleksandr Redko <oleksandr.red+github@gmail.com>
|
@alexandear updated, thanks. I added I also added the public preview note to the Agent Tasks endpoint docs and kept I checked the schema for Validation:
I leave the api20260310 / github.go constant discussion untouched until @stevehipwell answers. |
# Conflicts: # github/github.go
|
@stevehipwell - @alexandear - could you please take another look when you get a chance? |
Co-authored-by: Oleksandr Redko <oleksandr.red+github@gmail.com>
Co-authored-by: Oleksandr Redko <oleksandr.red+github@gmail.com>
Co-authored-by: Oleksandr Redko <oleksandr.red+github@gmail.com>
Co-authored-by: Oleksandr Redko <oleksandr.red+github@gmail.com>
Co-authored-by: Oleksandr Redko <oleksandr.red+github@gmail.com>
Co-authored-by: Oleksandr Redko <oleksandr.red+github@gmail.com>
|
@alexandear Done pushed the changes ,only thing i am not certain about is changing that date to '2025-03-14' but feel free to change it or let me know. |
Co-authored-by: Oleksandr Redko <oleksandr.red+github@gmail.com>
Co-authored-by: Oleksandr Redko <oleksandr.red+github@gmail.com>
| // previewDocsAPIVersions maps REST docs paths to preview API versions when the | ||
| // docs page requires a version other than metadataDocsAPIVersion. | ||
| var previewDocsAPIVersions = map[string]string{ | ||
| "/rest/agent-tasks/agent-tasks": "2026-03-10", | ||
| } |
There was a problem hiding this comment.
@gmlewis Maybe it's better to implement the 2022-11-28 version of the API and not add this var? Basically, for the /rest/agent-tasks/agent-tasks endpoints two API versions are the same.
Summary
Adds typed client support for GitHub's Agent Tasks REST API.
This implements the documented public-preview Agent Tasks endpoints:
GET /agents/repos/{owner}/{repo}/tasksPOST /agents/repos/{owner}/{repo}/tasksGET /agents/repos/{owner}/{repo}/tasks/{task_id}GET /agents/tasksGET /agents/tasks/{task_id}Closes #4213.
Changes
AgentTasksServiceand registered it onClient.Notes
The Agent Tasks API is currently in public preview, so this PR keeps the implementation scoped to the fields and endpoints currently documented by GitHub.
Validation
Ran the repository validation flow from
CONTRIBUTING.md:script/fmt.shscript/test.sh ./...script/lint.shscript/generate.shgit diff --checkscript/test.shwith the default race configuration could not run on this Windows machine becausecgo/gccwas not available. I reran the full test script with the non-race fallback across all modules, and it passed.